import os
import platform

from get_log import GetLog

logging = GetLog().get_log('logs')

plt = platform.system()


# 多平台不阻塞启动子进程方法  from  https://blog.csdn.net/mr_li1/article/details/89353276
def run():
    logging.info(plt)
    if plt == 'Darwin':
        os.system('./exinfo-macos &')
    elif plt == 'Linux':
        os.system('./exinfo-linux &')
    elif plt == 'Windows':
        os.system('start exinfo-win.exe')


def exit0():
    if plt == 'Windows':
        os.system('taskkill /f /im %s' % 'exinfo.exe')
    elif plt == 'Linux':
        os.system('pkill exinfo-linux')
    elif plt == 'Darwin':
        os.system('pkill exinfo-macos')
    # exit()
